/*************************************************************************
	> File Name: led.c
	> Author: life
	> Created Time: Sun 28 Mar 2021 09:56:08 BST
 ************************************************************************/

#include<stdio.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

 int main(int argc, char **argv)
{
   int fd,pinvalue;

 fd = open("/dev/ledzfj",O_RDWR);
 if(fd<0)
 {
	 printf("open fail \n");
	 return -1;
 }
 printf("open success fd=%d \n", fd);

if( argc > 1 )
{
 pinvalue= atoi(argv[1]);
 write(fd,&pinvalue,sizeof(int));
 printf("str =%s \n", argv[1]);
 }
 close(fd);
 }

